//#include <iostream>
//using namespace std;
//const int N = 110, M = 10010;
//int n, m;
//int a[N];
//int f[N][M];
//int main()
//{
//	cin >> n >> m;
//	for (int i = 1; i <= n; i++) cin >> a[i];
//	f[0][0] = 1;
//	for (int i = 1; i <= n; i++)
//	{
//		for (int j = 0; j <= m; j++)
//		{
//			f[i][j] = f[i - 1][j];
//			if (j >= a[i]) f[i][j] += f[i - 1][j - a[i]];
//		}
//	}
//	cout << f[n][m] << endl;
//	return 0;
//}
#include <iostream>
using namespace std;
const int N = 110, M = 10010;
int n, m;
int a[N];
int f[M];
int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++) cin >> a[i];
	f[0] = 1;
	for (int i = 1; i <= n; i++)
	{
		for (int j = m; j >= a[i]; j--)
		{
			
			f[j] += f[j - a[i]];
		}
	}
	cout << f[m] << endl;
	return 0;
}